package com.code.day010JieKo.not09JK;

public class Computer {
    public void start() {
        System.out.println("开机");
    }

    public void useUSB(USB usb) {
        if (usb instanceof Mouse mouse) {
            mouse.start();
            mouse.stop();
        }
        if (usb instanceof KeyBoard keyboard) {
            keyboard.start();
            keyboard.stop();
        }

    }

    public void stop() {
        System.out.println("关闭");
    }
}
